﻿Imports OMANE.Common.UI
Imports OMANE.Common
Imports System.ComponentModel
Imports PTIC_Util
Imports System.Windows.Input

Namespace ViewModels
    Public Class ViewModelStressTests
        Inherits ViewModelCommand
        Implements IViewModelTabSection


        Sub New()
            Title = "STRESS TESTS"
        End Sub
        Private _Model As ModelTauxGarantis
        Public Sub New(ByVal Model As ModelTauxGarantis, ByVal DisplayName As String, ByVal Command As ICommand)
            MyBase.DisplayName = DisplayName
            _Model = Model
            Title = "STRESS TESTS"
        End Sub

        Public Property Icone As String Implements Common.UI.IViewModelTabSection.Icone
        Public Property Title As String Implements Common.UI.IViewModelTabSection.Title
        Public Property IsClosable As Boolean Implements IViewModelTabSection.IsClosable

    

        Private _ModificationPretsImmobiliers As IEnumerable = TestData.SimpleData
        Public Property ModificationPretsImmobiliers As IEnumerable
            Get
                Try
                    _Model = Locator.ModelStatic
                    Dim tble As DataTable = _Model.ListeTraitements.TraitMoteurMethode1.simulations.SimulST_Immo.resultats
                    Dim q = From e In tble Select X = CDbl(e("ST_Immo")), Y = CDbl(e("S/P"))
                    Return q.AsEnumerable()
                Catch ex As Exception
                    Return _ModificationPretsImmobiliers
                End Try
            End Get
            Set(ByVal value As IEnumerable)
                OnPropertyChanging("ModificationPretsImmobiliers")
                _ModificationPretsImmobiliers = value
                OnPropertyChanged("ModificationPretsImmobiliers")
            End Set
        End Property

        Private _ModificationProportionAge As IEnumerable = TestData.SimpleData
        Public Property ModificationProportionAge As IEnumerable
            Get
                Try
                    _Model = Locator.ModelStatic
                    Dim tble As DataTable = _Model.ListeTraitements.TraitMoteurMethode1.simulations.SimulST_Tr_age.resultats
                    Dim q = From e In tble Select X = CDbl(e("ST_Tr_age")), Y = CDbl(e("S/P"))
                    Return q.AsEnumerable()
                Catch ex As Exception
                    Return _ModificationPretsImmobiliers
                End Try
            End Get
            Set(ByVal value As IEnumerable)
                OnPropertyChanging("ModificationProportionAge")
                _ModificationProportionAge = value
                OnPropertyChanged("ModificationProportionAge")
            End Set
        End Property


    End Class
End Namespace
